/*
 * com.javable.cese -- Cell Electrophysiology Simulation Environment (CESE)
 *
 * Copyright (C) 1999 - 2005 Sergey Missan
 *
 * Dalhousie Univ., Halifax, NS, Canada
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

package models.com.javable.cese.models;

import java.awt.Image;
import java.beans.BeanDescriptor;
import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.beans.SimpleBeanInfo;

public class FitzHughNagumoModel_1961BeanInfo extends SimpleBeanInfo {

  /** Icon for image data objects. */
    private Image icon;

  /** Extended descriptor for this bean. */
    private BeanDescriptor descriptor;

  /** Array of property descriptors. */
    public FitzHughNagumoModel_1961BeanInfo() {
        icon = loadImage ("model_cardiac.png");
    }

  /** Provides the Models's icon */
    public Image getIcon(int type) {
        return icon;
    }

    /** Provides the Models's descriptor */
    public BeanDescriptor getBeanDescriptor(){
    	descriptor = new BeanDescriptor(FitzHughNagumoModel_1961.class);
    	descriptor.setDisplayName("The FitzHugh-Nagumo Simplified Cardiac Action Potential Model, 1961");
        descriptor.setShortDescription(
        "The FitzHugh-Nagumo Simplified Cardiac Action Potential Model, 1961 <p>" +
        "Biophys J 1961;1:445-466  <br>" +
        "Chaos, Solitons and Fractals 1996;7:293-301.");

        descriptor.setValue("version", "1.4");
    	return descriptor ;
    }

  /** Create a new property descriptor
   * @return Property Descriptor
   */
    private PropertyDescriptor createPropertyDescriptor (String name, String gett, String sett, String group) {
        PropertyDescriptor pd=null;
        try {
            pd = new PropertyDescriptor (name, FitzHughNagumoModel_1961.class, gett, sett);
            pd.setShortDescription(group);
        }
        catch (IntrospectionException ex) {}
        return pd;
    }

  /** Descriptor of valid properties
   * @return array of properties
   */
    public PropertyDescriptor[] getPropertyDescriptors () {
        PropertyDescriptor[] desc =
        {
            createPropertyDescriptor ("Membrane voltage (mV)",  "getv", "setv","Voltage"),
	    createPropertyDescriptor ("Cell capacitance (pF)",  "getcm", "setcm","Voltage"),

	    createPropertyDescriptor ("Resting potential (mV)",  "getvr", "setvr","Excitation threshold"),
	    createPropertyDescriptor ("Peak potential (mV)",  "getvp", "setvp","Excitation threshold"),
	    createPropertyDescriptor ("Excitation threshold potential (mV)",  "getvth", "setvth","Excitation threshold"),

            createPropertyDescriptor ("Time step (ms)",  "getdt", "setdt","Time Step"),
            createPropertyDescriptor ("Initial time (ms)",  "gett", "sett","Time Step"),

            createPropertyDescriptor ("Stimulus amplitude (uA/cm^2)",  "getst", "setst","Total Current and Stimulus"),
            createPropertyDescriptor ("Time when stimulus is applied (ms)",  "gettstim", "settstim","Total Current and Stimulus"),
            createPropertyDescriptor ("Stimulus duration (ms)",  "getstl", "setstl","Total Current and Stimulus"),
            createPropertyDescriptor ("Total experiment time (ms)",  "getetime", "setetime","Total Current and Stimulus"),
            createPropertyDescriptor ("Basic cycle length (ms)",  "getbcl", "setbcl","Total Current and Stimulus"),

	    createPropertyDescriptor ("Time constant of the slow current (ms^-1)",  "getb", "setb","Slow current"),
	    createPropertyDescriptor ("Slow current resistance",  "getd", "setd","Slow current"),


            createPropertyDescriptor ("|OUT Membrane voltage (mV)",  "getv", null,"Voltage"),
            createPropertyDescriptor ("|OUT d voltage / d time (mV/ms)",  "getdvdt", null,"Voltage"),

            createPropertyDescriptor ("|OUT Total current (uA/cm^2)",  "getit", null,"Total Current"),
            createPropertyDescriptor ("|OUT Total ion flow (mM/ms)",  "getiont", null,"Total Current"),

	    createPropertyDescriptor ("|OUT Dimensionless potential",  "getu", null,"Excitation threshold"),
	    createPropertyDescriptor ("|OUT Excitation threshold",  "getalpha", null,"Excitation threshold"),
	    createPropertyDescriptor ("|OUT Slow current",  "getvv", null,"Slow current"),

            createPropertyDescriptor ("Number of iterations",  "getsteps", null,"Time Step"),
        };
        return desc;
    }
}